<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Stream Filters: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="fundamentals.html" title="Part II. GMime Fundamentals">
<link rel="prev" href="gmime-streams.html" title="Streams">
<link rel="next" href="gmime-data-wrappers.html" title="Data Wrappers">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="fundamentals.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gmime-streams.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gmime-data-wrappers.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gmime-filters"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Stream Filters</span></h2>
<p>Stream Filters — How to use Stream Filters</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="filter-overview"></a><h2>Overview of Filters</h2>
<p>Stream filters are an efficient way of converting data from
    one format to another. To use a stream filter, you must first
    construct a GMimeStreamFilter stream and then add the desired
    filters to it.</p>
<p>GMime comes equipped with some basic filters such as
    GMimeFilterBasic, GMimeFilterCharset, GMimeFilterDos2Unix,
    GMimeFilterUnix2Dos, GMimeFilterFrom and GMimeFilterHTML.</p>
<p>The GMimeFilterBasic filter is actually a collection of
    filters for common transfer encodings used by MIME. So far, it is
    able to handle encoding and decoding of base64, quoted-printable
    and (x-)uuencode.</p>
<p>For internationalization support, GMime also includes a
    filter for converting between any 2 charsets,
    GMimeFilterCharset. With this filter, mail user agents can allow
    the user to read the message content in his or her own
    charset.</p>
<p>A common conversion needed for text is CRLF -&gt; LF and LF -&gt;
    CRLF which is needed for most (all?) internet protocols. Luckily,
    GMime comes equipped with a set of filters to handle this for you:
    GMimeFilterDos2Unix and GMimeFilterUnix2Dos.</p>
<p>On Unix systems, mail often resides in spools in mbox
    format. Mbox uses a line that starts with "From " to delimit
    messages which means that message bodies are forbidden to contain
    lines starting with "From ". The common way to escape these from
    lines in message bodies is to prepend the line with a greater-than
    character ('&gt;') producing "&gt;From ". You'll find GMimeFilterFrom
    handy when dealing with this.</p>
<p>The GMimeFilterHTML filter converts a normal text stream
    into an html stream. This is especially useful if you are using a
    widget such as GtkHTML to display the contents of an email
    message.</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>